﻿package Chapter03;

public class VariableScope {
	static String name;
	static int old;
	static float height;
	
	public int summery(int a, int b) {
		int big = 0;
		int small = 0;
		
		if (a<=b) {
			big = b;
			small = a;
		} else {
			big = a;
			small = b;
		}
		
		int sum = 0;
		for (int i = small; i <= big; i++) {
			sum += i;
		}
		return sum;
	}
	
	public void change() {
		old = 50;
	}
	
	/**
	 * @param args
	 */
	public void run() {
		name = "john";
		old = 32;
		height = 175.6f;

		System.out.printf("[%s] 今年 %d 歲, %.2f公分高\n",name, old, height);
		change();
		System.out.printf("[%s] 今年 %d 歲, %.2f公分高\n",name, old, height);
	}
}
